#include"List.h"

SLD* Openmem(pphead)
{
	//assert(pphead);
	SLD * CUT = (SLD*)malloc(sizeof(SLD));
	assert(CUT);
	return CUT;
}
void SLinit(SLD** pphead)
{
	assert(pphead);
	SLD* cut = Openmem(*pphead);
	*pphead = cut;
	cut->next = *pphead;
	cut->prev = *pphead;
	cut->num = 0;
}
void SLPushBack(SLD* phead, classnode x)
{
	SLD* cut = Openmem(phead);
	cut->num = x;
	SLD* head = phead;
	while (head->next != phead)
	{
		head = head->next;
	}
	phead->prev = cut;
	cut->next = phead;
	cut->prev = head;
	head->next = cut;

}
void SLprint(SLD* phead)
{
	SLD* cut = phead;
	printf("head->");
	if (phead == NULL)
	{
		return;
	}
	while (cut->next != phead)
	{
		printf("%d->", cut->next->num);
		cut = cut->next;
	}
	printf("head");
}


